<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/tiles2/common.jsp" %>    
<div class="page-header">
	<img class="fleft titlelogo" 
		src="img/ext/glyphicons_244_conversation.png">
	<h1>게시판</h1>
</div>
<article>
	<div class="row">
		<div class="span5 offset1">
			<h3 class="dragup"><img class="iconalign" src="img/ext/glyphicons_190_circle_plus.png">새글쓰기</h3>
		</div>
		<div class="span5 tright" >
			<a class="btn"><i class="icon-list"></i>&nbsp;목록으로</a>
		</div>
	</div>
	<div class="row">
		<div class="span10 offset1">
			<form class="well form-horizontal" id="boardfrm">
				<fieldset>
					<div class="control-group error">
						<label class="control-label" 
						for="title">제목</label>
						<div class="controls">
						<input type="text" id="title" name="title"
						class="span6">
						</div>
					</div>
					<div class="control-group error">
						<label class="control-label" 
						for="contents">본문</label>
						<div class="controls">
							<textarea rows="20" class="span6"
							id="contents" name="contents"></textarea>
						</div>
					</div>
					<div class="control-group error">
						<label class="control-label" 
						for="captcha">자동가입방지</label>
						<div class="controls">
							<img><br/>
							<input type="text" id="captcha"
							name="captcha" class="span3">
							<a class="btn btn-inverse">
							<i class="icon-question-sign icon-white"></i>
							다른 captcha 보기</a>
						</div>
					</div>				
				</fieldset>
				<hr class="hdivider">
				<div class="tcenter">
					<a class="btn btn-danger" 
					id="savebtn">입력완료</a>
					<a class="btn btn-primary" 
					id="notsave">취소하기</a>
				</div>
				
				<input type="hidden" name="uid" value="noName" />				
				
			</form>		
		</div>
	</div>
</article>

<script>
	$("#savebtn").on("click", function(event) {
		if ($("#title").val() == "") alert(); 
		else if ($("#contents").val() == "") alert();
		else {
			$("#boardfrm").attr("method", "post")
			.submit();
		}
	});
	$("#notsave").on("click", function(event) {
		if (confirm("정말로, 진짜로, 사실로, 참말로?"))
			$(location).attr("href", 
					"<c:url value='/board/list.mvc'/>");			
	});
</script>








